package kaoshi;

public class Quest2 {
    public static int fi(int n){
        int a=1,b=1,c=1,d;
        for (int i = 3; i < n; i++) {
            d=a+b+c;
            c=b;
            b=a;
            a=d;
        }
        return a;
    }

    public static void main(String[] args) {
        System.out.println(fi(10));
    }
}
